package chess;

/**
 * 棋子父类
 */

/*
    id用于在棋盘上显示，还有判别阵营
    名字用来显示
    棋子对应血量
    category 主要用于判断棋子大小
    camp 主要区分阵营. 1为红方. 2为黑方
 */
public abstract class Piece {

    private int id; // 棋子id
    private String name; // 棋子名字
    private int blood; // 棋子对应血量
    private int category; //类别
    private int camp; // 阵营

    public Piece(int id, String name, int blood, int category, int camp) {
        this.id = id;
        this.name = name;
        this.blood = blood;
        this.category = category;
        this.camp = camp;
    }

    //是否可以移动

    /**
     *
     * @param chessBoard 棋盘
     * @param x1 要移动位置的横坐标
     * @param y1 要移动位置的纵坐标
     * @param x 棋盘原位置x
     * @param y 棋盘原位置y
     * @return
     */
    public abstract boolean isMove(Piece[][] chessBoard, int x1, int y1, int x, int y);

    public abstract boolean isComMoveX(Piece[][] chessBoard, int x1, int y1, int x, int y);
    public abstract boolean isComMoveY(Piece[][] chessBoard, int x1, int y1, int x, int y);


    public String getName() {
        return name;
    }

    public int getId() {
        return id;
    }

    public int getBlood() {
        return blood;
    }

    public int getCategory() {
        return category;
    }

    public int getCamp() {
        return camp;
    }
}
